import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DefaultComponent } from '../components/default/default.component';
import { PassportComponent } from '../login/passport/passport.component';
import { LoginComponent } from '../login/passport/login/login.component';
import {SiderComponent} from '../common/components/sider/sider.component';
import {MyHomeComponent} from '../components/myHome/myHome.component';

const routes: Routes = [
    { path: '', redirectTo: 'passport', pathMatch: 'full' },
    /** 登陆布局 */
    {
      path: 'passport',
      component: PassportComponent,
      children: [
        { path: '', redirectTo: 'login', pathMatch: 'full' },
        { path: 'login', component: LoginComponent }
      ]
    },   {
      path: 'modal',
      component: SiderComponent,
    },
  /**默认布局 */
  {
    path: 'default',
    component: DefaultComponent,
    // children: [
    //   { path: '', redirectTo: 'index', pathMatch: 'full' },
    //   { path: 'index', component: InfoComponent }
    // ],
    //   // canActivate: [ACLGuard],
    children: [
      { path: '', redirectTo: 'home', pathMatch: 'full' },
      { path: 'home', component: MyHomeComponent },
      {
        path: 'home', loadChildren: '../components/components.module#ComponentsModule'
      },

    ]
  },
];
@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class RouteRoutingModule { }
